package com.example.administrator.myapplication.fragments;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.ShOneActivity;
import com.example.administrator.myapplication.ShTwoActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class ShFragment extends Fragment {


    ImageView mIvTubiao3;
    ImageView mIvTubiao8;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_sh, container, false);
        mIvTubiao3 = view.findViewById(R.id.tubiao3);
        mIvTubiao8 = view.findViewById(R.id.tubiao8);
        return view;
    }

    public void onActivityCreated(@Nullable Bundle savedInstanceState){
        super.onActivityCreated(savedInstanceState);
        mIvTubiao3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), ShOneActivity.class);
                startActivity(intent);
            }
        });
        mIvTubiao8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), ShTwoActivity.class);
                startActivity(intent);
            }
        });
    }

}
